package com.ccrfid.rmc6.repository.personnel;

import com.ccrfid.rmc6.entity.personnel.PersonnelMutualGroupMemberEntity;
import org.springframework.data.repository.Repository;

import java.util.List;

public interface PersonnelMutualGroupMemberRepository extends Repository<PersonnelMutualGroupMemberEntity, Long> {

    PersonnelMutualGroupMemberEntity save(PersonnelMutualGroupMemberEntity entity);

    void deleteAllByGroupId(Long groupId);

    void deleteById(Long id);

    void deleteByIdAndGroupId(Long id, Long groupId);

    Boolean existsByGroupId(Long gorupId);

    Boolean existsById(Long id);

    Boolean existsByIdAndGroupId(Long id, Long groupId);

    Boolean existsByGroupIdAndPersonnelId(Long groupId, Long personnelId);

    PersonnelMutualGroupMemberEntity getByGroupIdAndPersonnelId(Long groupId, Long personnelId);

    List<PersonnelMutualGroupMemberEntity> getAllByGroupId(Long groupId);
}
